RWA_TAG_ATTR


Purpose

Uses tag names taken from a dynamic array to format attributes from a second dynamic array. For each attribute in the tag list, the corresponding attribute in the second array is enclosed in a pair of tags of the specified type. Appends generated code to vString.

Syntax

RWA_TAG_ATTR(vString, aTagList, aAttrList, Start, aClass)

Parameters

vString A variable containing the string to which the generated code is appended. On return, the variable contains the modified string. If the string does not exist, it is created.

aTagList A dynamic array containing a list of tag names, one per attribute.

aAttrList A dynamic array containing a list of attributes to be tagged, one per attribute.

Start The number of the first attribute in aAttrList to be tagged. Item numbering starts from 1.

aClass A dynamic array that can be used to set attributes of the tags. For information about using aClass, see The aClass Parameter.

Example

If TAGS contains the following:

"type":AM:"make":AM:"model":AM:"colour"

and CAR contains the following:

"4-door saloon":AM:"Ford":AM:"Escort":AM:"Blue"

calling

RWA_TAG_ATTR(STRING, TAGS, CAR, 1, "")

appends the following to STRING:

<type>4-door saloon</type>
<make>Ford</make>
<model>Escort</model>
<colour>Blue</colour>

Go to top button